package com.xl.observer.special;

public class Client {

    public static void main(String[] args) throws InterruptedException {

        ConcreateWeatherSubject concreateWeatherSubject = new ConcreateWeatherSubject();

        ConcreateWeatherObserver gf = new ConcreateWeatherObserver();
        gf.setObserverName("gf");

        ConcreateWeatherObserver mom = new ConcreateWeatherObserver();
        mom.setObserverName("mom");

        concreateWeatherSubject.attach(gf);
        concreateWeatherSubject.attach(mom);

        System.out.println("start\n");
        concreateWeatherSubject.setWeather("晴天");

        System.out.println("\n");
        Thread.sleep(1000);

        concreateWeatherSubject.setWeather("下雨");

        System.out.println("\n");
        Thread.sleep(1000);

        concreateWeatherSubject.setWeather("下雪");

    }
}
